/** When your routing table is too long, you can split it into small modules **/

import Layout from '@/layout'

const nestedRouter = {
  path: '/nested',
  component: Layout,
  redirect: '/nested/menu1/menu1-1',
  name: 'Nested',
  meta: {
    title: '数据中心  ',
    icon: 'nested'
  },
  children: [
    {
      path: 'menu1',
      component: () => import('@/views/nested/menu1/index'), // Parent router-view
      name: 'Menu1',
      meta: { title: '仓库管理', icon: 'cangku' },
      redirect: '/nested/menu1/menu1-1',
      children: [
        {
          path: 'menu1-1',
          component: () => import('@/views/nested/menu1/menu1-1/index'),
          name: 'Menu1-1',
          meta: { title: '药品仓库' }
        },
        {
          path: 'menu1-3',
          component: () => import('@/views/nested/menu1/menu1-2/index'),
          name: 'Menu1-3',
          meta: { title: '操作记录' }
        }
      ]
    },
    {
      path: 'menu2',
      component: () => import('@/views/nested/menu2/index'),
      name: 'Menu2',
      redirect: '/nested/menu2/menu1-2-1',
      meta: { title: '医院维护', icon: '医院管理' },
      children: [
        {
          path: 'menu1-2-1',
          component: () => import('@/views/nested/menu2/menu1-2-1'),
          name: 'Menu1-2-1',
          meta: { title: '科室维护', icon: '管理科室' }
        },
        {
          path: 'menu1-2-2',
          component: () => import('@/views/nested/menu2/menu1-2-2'),
          name: 'Menu1-2-2',
          meta: { title: '医生维护', icon: '医生' }
        },
        {
          path: 'menu1-2-3',
          component: () => import('@/views/nested/menu2/menu1-2-3'),
          name: 'Menu1-2-3',
          meta: { title: '项目维护  ', icon: '体检项目' }
        },
        {
          path: 'menu1-2-4',
          component: () => import('@/views/nested/menu2/menu1-2-4'),
          name: 'Menu1-2-4',
          meta: { title: '医院动态  ', icon: '动态' }
        }
      ]
    }
  ]
}

export default nestedRouter
